<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ptv_backend_CI</title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>public/admin/css/style.css" />
<script type="text/javascript" src="<?php echo base_url();?>public/admin/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>public/admin/js/ddaccordion.js"></script>
<script type="text/javascript">
ddaccordion.init({
	headerclass: "submenuheader", //Shared CSS class name of headers group
	contentclass: "submenu", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})
</script>

</head>
<body>
<div id="main_container">

	<div class="header"></div>
    
    <div class="main_content">
		<div class="menu">
			<ul>
				<li><a class="current" href="<?php echo base_url(); ?>admin">Trang Chủ</a></li>
			</ul>
		</div> 
       
    <div class="center_content">  
    <div class="left_content">
            <div class="sidebarmenu">
                <a class="menuitem" href="<?php echo base_url(); ?>admin/add_product">Thêm Sản Phẩm</a>
                <a class="menuitem" href="<?php echo base_url(); ?>admin/update_select">Update Thông Tin Sản Phẩm</a>      
                <a class="menuitem_red" href="<?php echo base_url(); ?>admin/delete_select">Xóa Sản Phẩm</a>
                 
            </div>    
    </div>
    
    
    <div class="right_content">            
       <h2>THÊM 1 SẢN PHẨM</h2>
       
        <?php 
            if(isset($error) == TRUE && $error == 1)
                echo '<br>ID ĐÃ TỒN TẠI';
            $attributes = array('id' => 'add_product');
            echo form_open_multipart('insert/add_info_product',$attributes);
        ?>
<table>
    <tr>
        <td>ID sản phẩm : </td>
        <td><input type="text" name="product_id" id="product_id" value="<?php echo set_value('product_id'); ?>"/></td>
    </tr>
    <tr>
        <td>Loại sản phẩm : </td>
        <td>
            <select name="product_type" id="product_type">
                <option value="0">--- Select ---</option>
                <option value="1">Laptop</option>
                <option value="2">Tablet</option>
                <option value="3">Mobile</option>
            </select>
        </td>
    </tr>
    <tr>
        <td>Hãng : </td>
        <td> 
            <select name="product_type_branch" id="product_type_branch">
            </select>
        </td>
    </tr>
    <tr>
        <td>Tên sản phẩm : </td>
        <td><input type="text" name="product_name" id="product_name" value="<?php echo set_value('product_name'); ?>"/></td>
    </tr>
    <tr>
        <td>Giá sản phẩm : </td>
        <td><input type="text" name="product_price" id="product_price" value="<?php echo set_value('product_price');?>"/></td>
    </tr>
    
    <tr>
        <td>Thông số sản phẩm </td>
    </tr>
    <tr>
        <td>CPU : </td>
        <td><input type="text" name="product_cpu" id="product_cpu" value="<?php echo set_value('product_cpu');?>"/></td>
    </tr>
    <tr>
        <td>RAM : </td>
        <td><input type="text" name="product_ram" id="product_ram" value="<?php echo set_value('product_ram');?>"/></td>
    </tr>
    <tr>
        <td>HDD : </td>
        <td><input type="text" name="product_hdd" id="product_hdd" value="<?php echo set_value('product_hdd');?>"/></td>
    </tr>
    <tr>
        <td>VGA : </td>
        <td><input type="text" name="product_vga" id="product_vga" value="<?php echo set_value('product_vga');?>"/></td>
    </tr>
    <tr>
        <td>LCD : </td>
        <td><input type="text" name="product_lcd" id="product_lcd" value="<?php echo set_value('product_lcd');?>"/></td>
    </tr>
    <tr>
        <td>Lan : </td>
        <td><input type="text" name="product_lan" id="product_lan" value="<?php echo set_value('product_lan');?>"/></td>
    </tr>
    <tr>
        <td>Weight : </td>
        <td><input type="text" name="product_weight" id="product_weight" value="<?php echo set_value('product_weight');?>"/></td>
    </tr>
    <tr>
        <td>Pin : </td>
        <td><input type="text" name="product_pin" id="product_pin" value="<?php echo set_value('product_pin');?>"/></td>
    </tr>
    <tr>
        <td>OS : </td>
        <td><input type="text" name="product_os" id="product_os" value="<?php echo set_value('product_os');?>"/></td>
    </tr>
    <tr>
        <td>Optical : </td>
        <td><input type="text" name="product_optical" id="product_optical" value="<?php echo set_value('product_optical');?>"/></td>
    </tr>
    <tr>
        <td>Bảo Hành : </td>
        <td><input type="text" name="product_baohanh" id="product_baohanh" value="<?php echo set_value('product_baohanh');?>"/></td>
    </tr>
    
    <tr>
        <td>Thông số hình hình </td>
    </tr>
    
    <tr>
        <td>Ðường dẫn : </td>
        <td><input type="file" name="product_img_path" id="product_img_path" value="<?php echo set_value('product_img_path');?>"/></td>
    </tr>
    
    <tr>
        <td>Mô tả : </td>
        <td><input type="text" name="product_description" id="product_description" value="<?php echo set_value('product_description');?>" /></td>
        
    </tr>
    <tr>
        <td><input type="submit" value="Thêm sản phẩm"/></td>
    </tr>
    
</table>

</form>

<script type="text/javascript">
$(document).ready(function(){
    $('#product_type').change(function(e){
        $('#product_type_branch').load('add_product_type_branch/'+this.value);
    });
});    
</script>
    </div>          

    <div class="clear"></div>
    
    </div> <!--end of main content-->

    <div class="footer">
    </div>
</div>		
</body>
</html>